import 'package:flutter/material.dart';
import 'package:shudu/widget/sudoku/generator.dart';
import 'package:sprintf/sprintf.dart';

const Color mainColor = Color(0xFF307DF6);
// const String you = "You";

Map<LEVEL, String> levelName = {
  LEVEL.EASY: "简单",
  LEVEL.ORIDINARY: "普通",
  LEVEL.HARD: "困难",
  LEVEL.EXPERT: "专家",
  LEVEL.MASTER: "大师",
  LEVEL.MASTER_P: "宗师"
};

String durationStr(int countdownNum) {
  if (countdownNum < 60) {
    return sprintf("00:%02d", [countdownNum]);
  } else if (countdownNum < 100 * 60) {
    int minute = countdownNum ~/ 60;
    int second = countdownNum % 60;
    return sprintf("%02d:%02d", [minute, second]);
  } else {
    int minute = countdownNum ~/ 60;
    int second = countdownNum % 60;
    return "$minute:${sprintf("%02d", [second])}";
  }
}

String timeStr(int time) {
  DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(time);
  return sprintf("%02d月%02d日 %02d:%02d",
      [dateTime.month, dateTime.day, dateTime.hour, dateTime.minute]);
}
